// custom-tab-bar/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected: 0,
    color: '#999999',
    selectedColor: "#37c3fa",
    list: [
      {
        pagePath: "/pages/detail/detail",
        text: "明细",
        iconPath: "../images/tabbar_icon/mingxi.png",
        selectedIconPath: "../images/tabbar_icon/mingxi.png"
      },
      {
        pagePath: "/pages/record/record",
        text: "添加",
        iconPath: "../images/tabbar_icon/jilu.png",
        selectedIconPath: "../images/tabbar_icon/jilu_sc.png",
        isSpecial: true
      },
      {
        pagePath: "/pages/statistics/statistics",
        text: "统计",
        iconPath: "../images/tabbar_icon/tongji.png",
        selectedIconPath: "../images/tabbar_icon/tongji.png"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset;
      const url = data.path; 
      // this.setData({
      //   selected: data.index
      // })
      wx.switchTab({ url });
    }
  }
})
